<template>
  <div>
    <myheader></myheader>
    <div class="head">
        <div @click="$router.go(-1)" style="">
          <van-icon name="arrow-left" />
            返回
        </div>
        <div>图文资讯</div>
        <div></div>
    </div>
<hmpostblock v-for="(value) in newslist" :key="value.id" :list="value"
 @click.native="$router.push({path:`/new/show/${value.id}`})"></hmpostblock>
  </div>
</template>

<script>
import myheader from '../../components/myheader'
import hmpostblock from '../../components/hmpostblock'
import {getnews} from '../../apis/news'
export default {
components:{
    myheader,hmpostblock
},
data(){
return {
    newslist:[]
  }
},
  mounted(){
    getnews()
    .then(res=>{
      console.log(res);
      
        this.newslist=res.data.message
        // console.log( this.newslist);
    })
}
}
</script>

<style lang="less" scoped>


.head{
    padding: 0 .625rem;
     display: flex;
     justify-content: space-between;
    align-items: center;
    height: 1.666667rem;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ccc;
    font-size: .833333rem;
    color: #26a2ff;

}
</style>>

